package com.sky.exception;

import lombok.Data;

@Data
public class Result<T> {

    private Integer code;

    private String msg;

    private T data;

    public static <T> Result<T> success(T object) {
        Result<T> result = new Result<>();
        result.setCode(1);
        result.setData(object);
        return result;
    }

    public static <T> Result<T> error(){
        Result<T> result = new Result<>();
        result.setCode(0);
        return result;
    }

}
